<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<button id="id1">点我</button>
<button id="id2">点我2</button>
<button id="id3">点我3</button>
<button id="id4">点我4</button>

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">

    function show(data){
        console.log(data);
    }
    $("#id1").click(function () {
        //alert("haha");
        $.ajax(
            {
                url: "http://localhost:8080/hello",
                dataType:"jsonp",
                success: function (result) {
                    console.log(result);
                }
            }
        )
    });


    $("#id2").click(function () {
        $.ajax(
            {
                url: "http://localhost:8080/hello2",
                contentType:"application/json",
                success: function (result) {
                    console.log(result);
                }
            }
        )
    });


    $("#id3").click(function () {
        $.ajax(
            {
                url: "http://localhost:8080/hello3",
                contentType:"application/json",
                success: function (result) {
                    console.log(result);
                }
            }
        )
    });


    $("#id4").click(function () {
        //alert("haha");
        $.ajax(
            {
                url: "http://localhost:8080/hello4",
                success: function (result) {
                    console.log(result);
                }

            }
        )
    });
</script>
</body>

</html>